

<?php
include 'lib.php';
WebStart("Adelaide CS Forum");
$topic = getTotalTopic();
$member = getTotalMember();
$logined = false;
if(count($_POST)>0){
	$action=$_POST['action'];
	if($action == 'Login'){
		 $name=$_POST['pwuser'];
		 $userName = md5($name);
	 	 $password=md5($_POST['password']);
		 if(Login($userName,$password)){
		 $logined = true;
		 $_SESSION['user'] = $name;
		 header('Location: index.php');
		 
		 }else{
			 print "<p> WRONG UserName or Password </p>";
		 }
		}
	}
print'
<div class="t"><table cellspacing="0" cellpadding="0" width="100%">
	<tbody><tr class="tr2">
	<td width="*" style="padding-right:8px; height:24px; border-top:0">
';
scrollBar("Guide to Visiter &lt;News&gt;");
print'</td></tr></tbody></table>
<table cellspacing="0" cellpadding="0" width="100%">
	<tbody><tr class="tr3">
		<td style="line-height:1.4em;border-right:0;word-break:keep-all">
		<form action="index.php" method="post">
			<div>';
if(checkLogin()){
	print '<b><font color = "blue"> '.@$_SESSION['user'].' </font></b>';
	}else{
		htinput("text","pwuser","UserName",inputSize(8).setClass("gray input").setId("acpro_inp0"));
		htinput("password","password","",inputSize(8).setClass("input"));
		htinput("submit","action","Login",setClass("btn"));
	}
print'
			</div>
		</form>

	</td>
	<td style="border-left:0;text-align:right;padding-right:12px;line-height:1.4em;word-break:keep-all">
		Total <font color="blue">'.$topic.'</font> Topics |<font color="blue">'.$member.'</font> Members
		</td>
	</tr>
</tbody></table></div>
';

htdiv(
	htTable(tableTbody( tableTr(
								tableTh("<h3> >> Programming Study </h3>", setClass("h").setColspan("6"))
						).tableTr("","")
						.tableTr(tableTd("Forums",tableWidth("60").setClass("tac").setColspan("2"))
						.tableTd("Topic",setClass("tal y-style").htStyle(fullStyle("width:6%")))
						.tableTd("Latest Topicse",setClass("tal y-style").htStyle(fullStyle("width:20%")))
						.tableTd("Administrator",setClass("y-style").htStyle(fullStyle("width:12%")))
						,setClass("tr2") 
						 ) 
			).tableTbody(
				forumsCategories("Java Programming","Public Your Own Java Experience","Java").
				forumsCategories("PHP Programming","Web development","PHP").
				forumsCategories("C++ Programming","Program design","C++").
				forumsCategories("SQL","Database Design","SQL").
				forumsCategories("Schema","","Schema")
			)		
			,tableWidth("100"))
			,setClass("t"));
		

htinput("text","test","okok",inputSize(20).setId("sdadasd"));

WebEnd();
?>


